package com.dldata.devtools30.repository.sysform;


import com.dldata.devtools30.entity.DevtFormTypeEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**

 */
@Repository
public interface DevtFormTypeDao extends com.dldata.devtools30.repository.BaseRepository<DevtFormTypeEntity,String>, JpaSpecificationExecutor<DevtFormTypeEntity> {
        
        @Query("select t from DevtFormTypeEntity t order by t.xh")
        public List<DevtFormTypeEntity> getAllFormType();
        
        @Query("select t from DevtFormTypeEntity t where t.fTypeId = ?1 order by t.xh ")
        public List<DevtFormTypeEntity> getAllSubFormType(String typeId);
        
        
        @Query("select t from DevtFormTypeEntity t where t.name like  ?1 or t.sm like  ?1   order by t.xh")
        public List<DevtFormTypeEntity> getAllFormType(String serach);
        
        
        @Query("select t from DevtFormTypeEntity t where t.id = ?1 order by t.xh")
        public List<DevtFormTypeEntity> findByTypeId(String id);
        
        
        @Query("select f from DevtFormTypeEntity f where f.id = ?1 order by f.xh ")
        public List<DevtFormTypeEntity> getFormByTypeId(String id);
        
        
        
        @Query("select f from DevtFormTypeEntity f where f.fTypeId = ?1 and f.xh = ?2")
        public List<DevtFormTypeEntity> findByTypeIdXh(String typeId, int xh);

}
